package com.yc.controller;


import com.yc.entity.Commentsecord;
import com.yc.mapper.CommentsecordMapper;
import com.yc.service.ICommentsecordService;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * InnoDB free: 4096 kB 前端控制器
 * </p>
 *
 * @author ly
 * @since 2022-06-13
 */
@Controller
@RequestMapping("//commentsecord")
public class CommentsecordController {
    @Resource
    private CommentsecordMapper commentsecordMapper;
    @Resource
    private ICommentsecordService commentsecordService;

    @RequestMapping("queryByCmid")
    @ResponseBody
    public List< Commentsecord > queryByCmid(Integer cmid){
        return commentsecordMapper.queryByCmid(cmid);
    }

    @RequestMapping("addReview")
    @ResponseBody
    public Integer addReview(Integer cmid,Integer uid,String massage){
        return commentsecordService.addReview(cmid, uid, massage);
    }

    @RequestMapping("addPraise")
    @ResponseBody
    public Integer addPraise(Integer cmid,Integer uid,Integer cmsid){
        return commentsecordMapper.addPraise(cmid,uid,cmsid);
    }

    @RequestMapping("addStamp")
    @ResponseBody
    public Integer addStamp(Integer cmid,Integer uid,Integer cmsid){
        return commentsecordMapper.addStamp(cmid,uid,cmsid);
    }
}

